package cn.tedu.sp09.feign;


import cn.tedu.pojo.Item;
import cn.tedu.pojo.User;
import cn.tedu.web.util.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

//根据服务id，从注册表得到主机地址
@FeignClient(name = "user-service",fallback =UserClientFB.class )
public interface UserClient {

    @GetMapping("/{userId}")
    JsonResult<User> getUser(@PathVariable Integer userId);


    @GetMapping("/{userId}/score")
    JsonResult<?> addScore(@PathVariable Integer userId,
                           @RequestParam Integer score);
}
